﻿<!DOCTYPE html>
<html>
<head>
<link rel="icon" href="{site}/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="{site}/favicon.ico" type="image/x-icon">
<link rel="bookmark" href="{site}/favicon.ico" type="image/x-icon">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta name="format-detection" content="telephone=no"/>
<link rel="stylesheet" type="text/css" href="{site}/Public/Css/mobile/public.css">
<link rel="stylesheet" type="text/css" href="{site}/Public/Css/mobile/fatie.css">
<script type="text/javascript" src="{site}/Public/JScript/public.js?<?php echo time();?>"></script>
<title>{site_config->site_title_mobile}</title>
<script>
var xmlhttp;
if (window.ActiveXObject) {
	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} else {
	xmlhttp = new XMLHttpRequest();
}
function check() {
	var addr = window.location.pathname;
	addr = addr.substring(0, addr.length - shtml.length);
	addr = addr.split(url);
	addr = addr[addr.length - 1];
	if (document.getElementById('zuozhe1').value == '') {
		alert('您没有权限，请先登录!');
		return false;
	} else if (document.getElementById('content').value == '') {
		alert('内容不能为空!');
		return false;
	} else {
		var val = document.getElementById('content').value.replace(/\[quote](.*?)\[\/quote]/g, "");
		if (val.replace(/^\s+/, "").replace(/\s+$/, "") == '') {
			alert('禁止空引用!');
			return false;
		}
		xmlhttp.open("POST", rooturl + "/index.php/Content" + url + "setParentID" + shtml, true);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlhttp.send("talk_id=" + parseInt(addr));
		xmlhttp.onreadystatechange = function() {
			if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
				document.forms['form1'].submit();
			} else {
				return false;
			}
		}
	}
	return false;
}
function setCaretPosition(tObj, sPos) {
	if (tObj.setSelectionRange) {
		setTimeout(function() {
			tObj.setSelectionRange(sPos, sPos);
			tObj.focus();
		}, 0);
	} else if (tObj.createTextRange) {
		var rng = tObj.createTextRange();
		rng.move('character', sPos);
		rng.select();
	}
}
</script>
</head>
<body>
	<!--头部开始-->
		<header>
			<div class="top_head white">
	    <div class="box1">
	        <a href="javascript:history.go(-1);" class="back"></a>
	    </div>
	    <div class="box2">
	        <a href="{site}">{site_config->site_title_mobile}</a></div>
	    <div class="box3">
	        	<?php if(empty($_SESSION['youyax_user'])){	?>
	            <a  href="__APP__/Login{url}loginMobile{shtml}"><span class="header_user">用户登录</span></a>
	          <?php	}else{	?>
	          <a href="__APP__/Index{url}self{shtml}"><span class="header_user">{user}</span></a>
	        <?php	}	?>
	    </div>
			</div>
		</header>
	<!--头部结束-->	
	<section class="txtBox" style="margin-top:10px;">
     <form name="form1" id="form" method="post" action="__APP__/List{url}insert2{shtml}">
       <input name="zuozhe1"  id="zuozhe1"  type="hidden" value="{user}">
       <textarea id="content" name="content" class="hui con" placeholder="内容：大于10个字符"></textarea><span id="conerror"  style="background:#fffbd9;color:#7d7d7d"></span>
       <input type="hidden" name="token" value="{token}">
       <input type="hidden" name="article1" value="{article1}">
			 <input type="hidden" name="article2" value="{article2}">
       <a href="javascript:void(0)" class="but_1" onclick="if(check()){document.forms['form'].submit();}" style="width:100px;">回复帖子</a>
     </form>
    </section>
	<?php 
			if("{bz}"=="1"){
				$con=strip_tags($this->array_array['result']['content']);
			}if("{bz}"=="2"){
				$con=strip_tags($this->array_array['result']['content1']);
			}
			$con=addslashes(htmlspecialchars_decode($con,ENT_QUOTES));
			$con=str_replace(array("\r\n","\n"),"",$con);
			$sub = array("<script>" => "&lt;script&gt;", "</script>" => "&lt;/script&gt;");
			$con=strtr($con,$sub);
		  $val='[quote]'.mb_substr($con,0,100,'utf-8').'......[/quote]';
		  echo '<script>
		    	document.getElementById("content").value="'.$val.'";
		    	document.getElementById("content").value+="\n";
		  </script>';
		  if(strpos($val,"&lt;script&gt;")){
		  	echo '<script>document.getElementById("content").value=document.getElementById("content").value.replace(/&lt;/g,"<");</script>';
		  }
		  if(strpos($val,"&lt;/script&gt;")){
		  	echo '<script>document.getElementById("content").value=document.getElementById("content").value.replace(/&gt;/g,">");</script>';
		  }
		  echo '<script>setCaretPosition(document.getElementById("content"),document.getElementById("content").value.length);</script>';
		?>
	<!--版权开始-->
	<footer>
		<div class="copyright">
   		<a>Powered BY YouYaX</a>
  	</div>
	</footer>
	<!--版权结束-->
	</body>
</html>